﻿using System;

namespace Vk.Methods.Users
{
    public class UserNameCase
    {
        public enum UserNameCaseEnum
        {
            Accusative,
            Dative,
            Genetive,
            Instrumental,
            Nominative,
            Prepositional
        }

        public string Value { get; }

        public UserNameCase(UserNameCaseEnum enumeration)
        {
            switch (enumeration)
            {
                case UserNameCaseEnum.Accusative:
                    Value = "acc";
                    break;
                case UserNameCaseEnum.Dative:
                    Value = "dat";
                    break;
                case UserNameCaseEnum.Genetive:
                    Value = "gen";
                    break;
                case UserNameCaseEnum.Instrumental:
                    Value = "ins";
                    break;
                case UserNameCaseEnum.Nominative:
                    Value = "nom";
                    break;
                case UserNameCaseEnum.Prepositional:
                    Value = "abl";
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(enumeration), enumeration, null);
            }
        }

        public override string ToString()
        {
            return Value;
        }

        public static implicit operator string(UserNameCase nameCase)
        {
            return nameCase.Value;
        }
    }
}